USE [sy_cwpb20140102]
GO

/****** Object:  Table [dbo].[CrossingRoad]    Script Date: 02/17/2014 11:15:28 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[CrossingRoadDraft](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[tableInfo_id] [int] NOT NULL,
	[zby] [int] NULL,
	[number] [int] NULL,
	[grp_id] [int] NOT NULL,
	[attenPlace] [nvarchar](50) NULL,
	[attenTime] [nvarchar](50) NULL,
	[trainTime] [nvarchar](50) NULL,
	[reptrain] [nvarchar](20) NULL,
	[stringRunTrain] [nvarchar](max) NULL,
	[offTrain] [nvarchar](20) NULL,
	[bCBackGarageTrainID] [nvarchar](20) NULL,
	[midStart] [int] NULL,
	[midOut] [int] NULL,
	[lastTrainTime] [nvarchar](50) NULL,
	[offTime] [nvarchar](50) NULL,
	[offPlace] [nvarchar](50) NULL,
	[miles] [nvarchar](50) NULL,
	[wHours] [nvarchar](50) NULL,
	[notes] [nvarchar](500) NULL,
	[isused] [int] NOT NULL,
	[draftName] [nvarchar](50) NOT NULL,
	[lastModifiedTime] [datetime]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[CrossingRoadDraft] ADD  CONSTRAINT [DF_CrossingRoadDraft_grp_id]  DEFAULT ((5)) FOR [grp_id]
GO

ALTER TABLE [dbo].[CrossingRoadDraft] ADD  CONSTRAINT [DF__CrossingRDraft__isuse__6D0D32F4]  DEFAULT ((1)) FOR [isused]
GO


alter table crossingroad add [lastModifiedTime] [datetime];